class CreateActsAsAddressTable < ActiveRecord::Migration
  def self.up
    create_table :base_addresses, :id => false, :force => true do |t|
      t.string :line1, :limit => 256, :null => false
      t.string :line2, :limit => 256
      t.string :city, :null => false, :limit => 128
      t.string :state, :null => false, :limit => 2
      t.string :zip_code, :null => false, :limit => 10
      # potentially add validation of zip code to db
      t.string :phone_number, :limit => 12, :null => false
      # potentially add validation of phone numbers to db

      t.timestamps
    end

    add_index :base_addresses, :state
    add_index :base_addresses, :city
    add_index :base_addresses, :zip_code
  end
  def self.down
     drop_table :base_addresses
  end
end

